package com.rt.tmpt.service;

import com.rt.tmpt.dto.A1OperationlogDto;
import com.rt.tmpt.dto.A2UserDto;
import com.rt.tmpt.dto.A3MenuDto;
import com.rt.tmpt.dto.Result;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface IMenuService {

	Result addMenu(A3MenuDto menuDto, long parentId);

	Result<A3MenuDto> queryMenuById(long id);

	Result<A3MenuDto> modifyMenuById(A3MenuDto menuDto);

	Result<A3MenuDto> batchUpdateMenusSort(List<A3MenuDto> a3MenuDtoList);

	Result<A3MenuDto> publishMenu(Integer pId, Map<String, Object> menuMap, Long userId);

	Result<A3MenuDto> removeMenuById(long id);

	Result<A3MenuDto> removeMenu4AllNodesById(long id);

	Result<A3MenuDto> queryMenus4RoleConf(Map<String, Object> paramMap);

	/**
	 * 用户的菜单和URL列表
	 * @param userId
	 * @return
	 */
	Result queryMenusByUser(long userId);

	/**
	 * 绑定角色 和 菜单
	 * @param roleId
	 * @param roleJsonArray
	 * @param logDto
	 * @return
	 */
	// Result bindRole_Menu(long roleId, String roleJsonArray, A1OperationlogDto logDto);

	/**
	 * Vue
	 * 绑定角色 和 权限
	 * @param roleId
	 * @param menuIdArr
	 * @param logDto
	 * @return
	 */
	Result bindAuths2Role(long roleId, String[] menuIdArr, Map dataLimitTypeMap, A1OperationlogDto logDto);

	/**
	 * 查询角色拥有的二级菜单
	 * @param roleId
	 * @return
	 */
	Result queryMenus4RoleConfByRoleId(long roleId);


	/**
	 * 权限管理，通过url查所有权限列表
	 * @param url
	 * @return
	 */
	Set<String> getMenu2AuthListByUrl(String url);


	/**
	 * 权限管理，登录时调用
	 * @param loginname
	 * @return
	 */
	A2UserDto getUserByLoginname(String loginname);


	/**
	 * 源码模式生成二级菜单
	 * @param paramMap
	 * long _templateTableId = (Long)paramMap.get("_templateTableId");
	 * long menuIdParent = (Long)paramMap.get("menuIdParent");
	 * String menuName = (String)paramMap.get("menuName");
	 * long userId = (Long)paramMap.get("userId");
	 * @return
	 */
	Result template2menuSourceCode(Map<String, Object> paramMap);

	/**
	 * 生成模板菜单
	 * @param paramMap
	 * long _templateTableId = (Long)paramMap.get("_templateTableId");
	 * long menuIdParent = (Long)paramMap.get("menuIdParent");
	 * String menuName = (String)paramMap.get("menuName");
	 * long userId = (Long)paramMap.get("userId");
	 * @return
	 */
	Result template2menu(Map<String, Object> paramMap);

	/**
	 * 图表：模板生成菜单 Multi
	 * @param paramMap
	 * long _templateTableId = (Long)paramMap.get("_templateTableId");
	 * long menuIdParent = (Long)paramMap.get("menuIdParent");
	 * String menuName = (String)paramMap.get("menuName");
	 * String pageType = (String)paramMap.get("pageType");
	 * long userId = (Long)paramMap.get("userId");
	 * @return
	 */
	// Result template2menu4Chart(Map<String, Object> paramMap);

	/**
	 *
	 * @param paramMap
	 * long _templateColumnId = (Long)paramMap.get("_templateColumnId");
	 * long menuIdParent = (Long)paramMap.get("menuIdParent");
	 * String menuName = (String)paramMap.get("menuName");
	 * String pageType = (String)paramMap.get("pageType");
	 * String columnName = (String)paramMap.get("columnName");
	 * long userId = (Long)paramMap.get("userId");
	 * @return
	 */
	// Result template2menu4ChartSingle(Map<String, Object> paramMap);


	/**
	 * 当前菜单转到一级菜单下
	 * @param id_change_position: 当前菜单
	 * @param menu1_id_change_position：一级菜单
	 * @return
	 */
	Result changeMenuToMenu1(long id_change_position, long menu1_id_change_position);


	/**
	 * OLAP 2 menu
	 * @param paramMap
	 * @return
	 */
	Result olap2menu(Map<String, Object> paramMap);
}
